<template>
    <tab-bar-scroll :tabs="data" :setbg="true" :tabIndex="tabIndex" @clickTab="clickTab" class="tab-bar-scroll-bg" />
</template>

<script>
import tabBarScroll from "@/components/common/tab-bar-scroll.vue"

export default {
	props: ["data"],
    components: {
        tabBarScroll,
    },
    data() {
        return {
            tabIndex: 0,
        }
    },
    methods: {
        clickTab(index) {
            if (this.tabIndex != index) {
                this.tabIndex = index
                this.$emit("clickTab", index)
            }
        },
    },
}
</script>

<style lang="scss">
.tab-bar-scroll-bg {
    background-color: $app-color-main;
}
</style>
